import xlrd  # 使用 openpyxl 替代 xlrd

# 从excel读取数据
def read_data_from_excel1(datas, i, i1, i2):
    wb = xlrd.open_workbook(r"d:\基础设置数据.xls")  # 使用 openpyxl 加载工作簿
    ws = wb.sheet_by_index(i1)  # 获取指定的工作表
    data = ws.row_values(i)[0:i2]  # 获取指定行的数据，i + 1 以适应 openpyxl 的行索引
    datas.append(data)  # 只取前 i2 列的数据

class ZHUCEData1():
    def data1(self):
        datas = []
        read_data_from_excel1(datas, 0, 1, 2)  # 这里的 0 代表第一行
        return datas
    def data2(self):
        datas = []
        read_data_from_excel1(datas, 1, 1, 2)
        return datas
    def data3(self):
        datas = []
        read_data_from_excel1(datas, 2,1,2)
        return datas
    def data4(self):
        datas = []
        read_data_from_excel1(datas, 3,1,1)
        return datas
    def data5(self):
        datas = []
        read_data_from_excel1(datas, 4,1,2)
        return datas
    def data6(self):
        datas = []
        read_data_from_excel1(datas, 5,1,2)
        return datas
    def data7(self):
        datas = []
        read_data_from_excel1(datas, 6,1,2)
        return datas
    def data8(self):
        datas = []
        read_data_from_excel1(datas, 7,1,2)
        return datas
    def data9(self):
        datas = []
        read_data_from_excel1(datas, 8,1,1)
        return datas
    def data10(self):
        datas = []
        read_data_from_excel1(datas, 9,1,2)
        return datas
    def data11(self):
        datas = []
        read_data_from_excel1(datas, 10,1,1)
        return datas
    def data12(self):
        datas = []
        read_data_from_excel1(datas, 11,1,2)
        return datas
    def data13(self):
        datas = []
        read_data_from_excel1(datas, 12,1,2)
        return datas
    def data14(self):
        datas = []
        read_data_from_excel1(datas, 13,1,2)
        return datas